<!-- <div id="title" class="row">
  <h1>{{ctrl.queue}} <span translate lib="web">workitemqueues</span></h1>
</div> -->
<div class="row">
  <div class="col-md-6">
  </div>

  <div class="col-md-6 text-right">
    <a ng-href="#/WorkitemQueue" class="btn btn-info" ng-show="ctrl.loading == false" title="Add new Workitem queue"><em
        class="fas fa-plus"></em></a>
    <em class="fas fa-plus btn disabled" ng-show="ctrl.loading == true"></em>
    <em class="fas fa-cog fa-spin" ng-show="ctrl.loading==true" title="Hang on, loading data"></em>
    <!-- <em class="fas fa-cog" ng-show="ctrl.loading!=true" title="I spin, while loading data"></em> -->
  </div>
</div>

<div ng-show="ctrl.errormessage != ''"" class=" alert alert-danger" role="alert">{{ctrl.errormessage}}</div>
<table id="table1" class="table table-striped" when-scrolled="ctrl.more()" style="width: 100%;">
  <thead class="thead-dark">
    <tr>
      <th ng-click="ctrl.ToggleOrder('name')"><strong translate lib="web">name</strong></th>
      <th ng-click="ctrl.ToggleOrder('maxretries')"><strong translate lib="web">maxretries</strong></th>
      <!-- <th ng-click="ctrl.ToggleOrder('projectid')"><strong translate lib="web">projectid</strong></th> -->
      <th ng-click="ctrl.ToggleOrder('_createdby')"><strong translate lib="web">createdby</strong></th>
      <th class="text-right"></th>
    </tr>
  </thead>
  <tbody>
    <tr ng-repeat="model in ctrl.models">
      <td>
        <a style="color: inherit; text-decoration: inherit;" ng-href="#/WorkitemQueue/{{model._id}}">
        {{model.name}}</a></td>
      <td class="col-1">{{model.maxretries}}</td>
      <!-- <td class="text-truncate">
        <a ng-href="#/Entity/openrpa/{{model.projectid}}">
          {{model.projectid}}
        </a>
      </td> -->
      <td class="col-2">{{model._createdby}}</td>
      <td class="text-right col-1">
        <div class="w-200 text-right">
          <a class="btn" ng-href="#/WorkitemQueue/{{model._id}}" title="Edit Workitem queue">
            <em class="fas fa-edit"></em>
          </a>
          <a href ng-click="ctrl.PurgeWorkitemQueue(model)" title="Purge all work items from queue" class="btn"
            ng-disabled="ctrl.loading==true"><em class="fas fa-eraser"></em></a>
          <a href ng-click="ctrl.DeleteWorkitemQueue(model)" class="btn"
            title="Delete Workitem Queue, fail if not empty" ng-disabled="ctrl.loading==true"><em
              class="fas fa-trash"></em></a>
        </div>
      </td>
    </tr>
  </tbody>
</table>